package com.example.net;

import java.net.InetAddress;

/**
 * @author zhaoyunlong
 * @date 2020/11/9
 * @description
 */
public class InetAddreddDemo {

    public static void main(String[] args) {

        try {
            InetAddress localHost = InetAddress.getLocalHost();
            System.out.println(localHost.toString());
            InetAddress byName = InetAddress.getByName("www.baidu.com");
            System.out.println(byName.toString());
        }catch (Exception e) {
            e.printStackTrace();
        }

    }
}
